﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserPass.ascx.cs" Inherits="MadeInPortugalWebApplication.WebControl.UserPass" %>
<style type="text/css">
    .MIP-user
    {
        text-align:right;
        width:100%;
        display:inline-block;
    }
</style>
<section id="page">
<asp:UpdatePanel runat="server" UpdateMode="Always" ID="UserPasswordUpdatePanel">
<Triggers>
        <asp:PostBackTrigger ControlID="btnLogin" />
        <asp:PostBackTrigger ControlID="btnLogout" />
    </Triggers>
    <ContentTemplate>
        <div class="MIP-user" runat="server" id="login">
            User: <span>
                <asp:TextBox ID="Tbxuser" runat="server" CssClass="input"></asp:TextBox></span>
            Password: <span>
                <asp:TextBox ID="TbxPassword" runat="server" CssClass="input" TextMode="Password"></asp:TextBox>
            </span>
            <asp:Button ID="btnLogin" runat="server" OnClick="btnLogin_Click" Text="Login" />
            <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/User.aspx">Register</asp:LinkButton>
            <asp:CustomValidator ID="PasswordValidator" runat="server" ErrorMessage="CustomValidator">Invalid User or Password</asp:CustomValidator>
        </div>
        <div class="MIP-user" runat="server" id="LoggedIn">
            Welcome
            <asp:Label ID="lblUserName" runat="server" Text=""></asp:Label>
            <asp:Button ID="btnLogout" runat="server" Text="Logout" OnClick="btnLogout_Click" />
        </div>
    </ContentTemplate>
</asp:UpdatePanel>
</section>